$(function(){
				
				
 var turl = decodeURI(window.location.href);
	var projectid = getUrlParam("id", turl);
	// 点击项目区域详情信息数据请求
	$.ajax({
		type: "GET",
        url: host + "volunteerProject/getProjectByid/"+projectid,
        dataType: "json",
        success: function(data){
					console.log(data)
					var showimg = 'http://101.201.113.151:9000'+data.showImage.split('ROOT')[1] ;
					$('.details .img').children('img').attr('src',showimg)
					// 赋值
					for (var m in data) {
       			$(".detailsbox ."+m).text(data[m]);
       		}
					//右侧项目联系人发起人赋值
					for (var m in data) {
						$("#content .right  ."+m).text(data[m]);
					}
					
					$.each(data.stations,function(index,item){
						console.log(item) 
					/* ctId = item.projectId;
						stationId += item.id+','; */
						$('.Add_signupbox').append('<div class="signupbox">'+
						                              
																					'<div class="top">'+
																						'<div class="">岗位：<span>'+item.stationName+'</span></div>'+
																						'<div class="">计划招募：<span>'+item.planSignNum+'</span></div>'+
																						'<div class="">已招募：<span>'+item.signNum+'</span></div>'+
																						'<div class="signupbtn">'+
																						    '<input type="hidden" value="'+projectid+'" class="userId">'+
																						    '<input type="hidden" value="'+item.projectId+'" class="projectId">'+
																						    '<input type="hidden" value="'+item.id+'" class="stationId">'+
																						'</div>'+
																					'</div>'+
																					'<div class="middle">'+
																						'<div class="">'+
																							'<i>岗位ID：</i>'+
																							'<span>'+item.id+'</span>'+
																						'</div>'+
																						'<div class="">'+
																							'<i>岗位描述：</i>'+
																							'<span>'+item.stationDesc+'</span>'+
																						'</div>'+
																						'<div class="">'+
																							'<i>岗位条件：</i>'+
																							'<span>'+item.stationConds+'</span>'+
																						'</div>'+
																					'</div>'+
																				'</div>')
						
					})
					
				$('.signupbtn').on('click',function(){
						var userid = $(this).children('.userId').val();
						var projectId = $(this).children('.projectId').val();
						var stationId = $(this).children('.stationId').val();
						
						$.ajax({
							type:"get",
							url:"http://101.201.113.151:9230/volunteerProject/signProject/"+userid+"/"+projectId+"/"+stationId,
							async:true,
							dataType:"json",
							success:function(data){
								console.log(data)
								if(data.code == "success"){
									alert("申请成功 请等待审核")
								}
							}
						})
						
					})
					
					
					
					
					
			
			
		}
 
	})
	
})